﻿using Dao;
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Business
{
    public class LoginBll
    {
        //用户登录，并验证用户
        public UserInfo LogonUser(string userID, string userPswd)
        {
            try
            {
                // 验证输入的用户名是否正确
                UserInfo userInfo = LogicDao.NewInstance.GetUser(userID);
                return userInfo;
            }
            catch (Exception ex)
            {
                return null;
            }
        }

        public UserInfo LogonAPPUser(string userID, string userPswd)
        {
            try
            {
                // 验证输入的用户名是否正确
                UserInfo userInfo = LogicDao.NewInstance.GetAPPUserInfo(userID);
                return userInfo;
            }
            catch (Exception ex)
            {
                return null;
            }
        }

        public UserInfo GetUserIDByUserCode(string uerCode)
        {
            try
            {
                UserInfo userInfo = LogicDao.NewInstance.GetUser(uerCode);
                return userInfo;
            }
            catch (Exception ex)
            {
                return null;
            }
        }
    }
}
